package com.yenlien.traceyun.business.controller;

import com.alibaba.fastjson.JSONObject;
import com.yenlien.traceyun.business.controller.response.BaseSoilView;
import com.yenlien.traceyun.business.dao.BaseSoilDao;
import com.yenlien.traceyun.business.dao.CompanyShowDao;
import com.yenlien.traceyun.business.dao.EquipmentDao;
import com.yenlien.traceyun.business.entity.BaseSoil;
import com.yenlien.traceyun.business.entity.CompanyShow;
import com.yenlien.traceyun.business.entity.Equipment;
import com.yenlien.traceyun.business.interceptor.UserAuthUtil;
import com.yenlien.traceyun.business.service.rest.usercenter.CompanyRestService;
import com.yenlien.traceyun.webase.controller.BaseController;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: bigwangy@sina.com
 * @create: 2021-01-04
 * @description:
 **/

@RestController
@RequestMapping("/companyshow")
public class CompanyShowController extends BaseController {

    @Autowired
    private CompanyShowDao companyShowDao;

    @Autowired
    private CompanyRestService companyRestService;

    @Autowired
    private BaseSoilDao baseSoilDao;

    @Autowired
    private EquipmentDao equipmentDao;

    /**
     * 修改企业秀
     *
     * @param show
     * @return
     */
    @PostMapping(value = "/update")
    public CompanyShow update(@RequestBody CompanyShow show) {
        return companyShowDao.save(show);

    }

    @GetMapping(value = "/load/{companyId}")
    public Object load(@PathVariable("companyId") String companyId) {
        return success(companyShowDao.findByCompanyId(companyId));
    }
}
